﻿using DataServer.CommonLib.Models.DataConfig;
using Swimj.CommonLib.Base;

namespace Config.RazorLib.Services
{
    public interface IDataConfigService
    {
        // [Get("/api/v1/dataconfigs")]
        Task<PaginatedResult<DataConfigInfoResponseDto>?> QueryDataConfigsByPage(DataConfigSearchRequestDto model);

        // [Put("/api/v1/dataconfigs/{id}")]
        Task<Result<DataConfigInfoResponseDto>> UpdateDataConfig(Guid id, DataConfigEditRequestDto editRequestDto);

        // [Post("/api/v1/dataconfigs")]
        Task<Result<DataConfigInfoResponseDto>> CreateDataConfig(DataConfigEditRequestDto editRequestDto);

        // [Get("/api/v1/dataconfigs/{id}")]
        Task<Result<DataConfigInfoResponseDto>> GetDataConfig(Guid id);

        // [Get("/api/v1/dataConfigs/{configCode}/fields")]
        Task<PaginatedResult<ConfigFieldInfoResponseDto>?> QueryDataConfigFieldsByPage(string configCode, ConfigFieldSearchRequestDto searchData);

        // [Get("/api/v1/dataConfigs/{configCode}/fields")]
        Task<Result<IList<ConfigFieldInfoResponseDto>>> QueryDataConfigFields(string configCode, ConfigFieldSearchRequestDto searchData);

        // [Get("/api/v1/dataConfigs/fields/{id}")]
        Task<Result<ConfigFieldInfoResponseDto>> GetDataConfigField(Guid id);

        // [Post("/api/v1/dataConfigs/{configCode}/fields")]
        Task<Result<ConfigFieldInfoResponseDto>> CreateDataConfigField(string configCode, ConfigFieldEditRequestDto? editData);

        // [Put("/api/v1/dataConfigs/fields/{id}")]
        Task<Result<ConfigFieldInfoResponseDto>> UpdateDataConfigField(Guid id, ConfigFieldEditRequestDto? editData);

        // [Get("/api/v1/dataConfigs/availableColumn/{configCode}")]
        Task<IList<ConfigColMetaInfoResponseDto>> QueryAvailableColumnByDataType(string configCode);

        // [Get("/api/v1/dataConfigs/{configCode}/rules")]
        Task<PaginatedResult<ConfigRuleInfoResponseDto>?> QueryDataConfigRulesByPage(string configCode, ConfigRuleSearchRequestDto searchData);

        // [Get("/api/v1/dataConfigs/rules/{id}")]
        Task<Result<ConfigRuleInfoResponseDto>> GetDataConfigRule(Guid id);

        // [Post("/api/v1/dataConfigs/{configCode}/rules")]
        Task<Result<ConfigFieldInfoResponseDto>> CreateDataConfigRule(string configCode, ConfigRuleEditRequestDto? editData);

        // [Put("/api/v1/dataConfigs/rules/{id}")]
        Task<Result<ConfigFieldInfoResponseDto>> UpdateDataConfigRule(Guid id, ConfigRuleEditRequestDto? editData);

    }
}
